Optimal. Leaf size=71 \[ a^2 x-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {a^2 \cos (c+d x)}{d}-\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {2952, 2715, 8,
2672, 327, 212, 2645, 30} \begin {gather*} -\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {a^2 \cos (c+d x)}{d}+\frac {a^2 \sin (c+d x) \cos (c+d x)}{d}-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+a^2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 30
Rule 212
Rule 327
Rule 2645
Rule 2672
Rule 2715
Rule 2952
Rubi steps
\begin {align*} \int \cos (c+d x) \cot (c+d x) (a+a \sin (c+d x))^2 \, dx &=\int \left (2 a^2 \cos ^2(c+d x)+a^2 \cos (c+d x) \cot (c+d x)+a^2 \cos ^2(c+d x) \sin (c+d x)\right ) \, dx\\ &=a^2 \int \cos (c+d x) \cot (c+d x) \, dx+a^2 \int \cos ^2(c+d x) \sin (c+d x) \, dx+\left (2 a^2\right ) \int \cos ^2(c+d x) \, dx\\ &=\frac {a^2 \cos (c+d x) \sin (c+d x)}{d}+a^2 \int 1 \, dx-\frac {a^2 \text {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}-\frac {a^2 \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=a^2 x+\frac {a^2 \cos (c+d x)}{d}-\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{d}-\frac {a^2 \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=a^2 x-\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}+\frac {a^2 \cos (c+d x)}{d}-\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {a^2 \cos (c+d x) \sin (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.27, size = 71, normalized size = 1.00 \begin {gather*} \frac {a^2 \left (9 \cos (c+d x)-\cos (3 (c+d x))+6 \left (2 \left (c+d x-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\sin (2 (c+d x))\right )\right )}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 73, normalized size = 1.03
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+2 a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3}}{d}\) | \(73\) |
default | \(\frac {a^{2} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+2 a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3}}{d}\) | \(73\) |
risch | \(a^{2} x +\frac {3 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{8 d}+\frac {3 a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {a^{2} \cos \left (3 d x +3 c \right )}{12 d}+\frac {a^{2} \sin \left (2 d x +2 c \right )}{2 d}\) | \(114\) |
norman | \(\frac {a^{2} x +a^{2} x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {4 a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a^{2}}{3 d}+\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {2 a^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+3 a^{2} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+3 a^{2} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {a^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(154\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 75, normalized size = 1.06 \begin {gather*} -\frac {2 \, a^{2} \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2} - 3 \, a^{2} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 86, normalized size = 1.21 \begin {gather*} -\frac {2 \, a^{2} \cos \left (d x + c\right )^{3} - 6 \, a^{2} d x - 6 \, a^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 6 \, a^{2} \cos \left (d x + c\right ) + 3 \, a^{2} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 3 \, a^{2} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int \cos ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx + \int 2 \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx + \int \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )} \csc {\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 101, normalized size = 1.42 \begin {gather*} \frac {3 \, {\left (d x + c\right )} a^{2} + 3 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {2 \, {\left (3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.04, size = 188, normalized size = 2.65 \begin {gather*} \frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {4\,a^2}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {2\,a^2\,\mathrm {atan}\left (\frac {4\,a^4}{4\,a^4-4\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {4\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,a^4-4\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________